fixed algorithm for searching for optimal absente