Added binary search function