added a binary search algorithm to task3

much faster