finished the scanner and user input for left right middle array[middle]