now working on exhaustive search optimization