Added binary search function.