added code to find min in rotated and sorted array