Improoved and working search_far algorithm