else move top down to eliminate upper half from consideration

else

top = mid + 1;