Added binary search code