fixed binary search and added rotated binary search