anxiety algorithm