added binary search algorithm to solution