implemented horizon search [tested]