seach rotated sort array

whenever using combination of if statements, make sure to capture every
possible case. start next if statement based on previously defined
conditions.