private static Order getOrderFromConsole() throws CancelOperationException {
			boolean validInput;
			char[] result = null;
			
			do {
				validInput = true;
							
				System.out.print("Retrieve earliest message instead of highest priority message [Y/N]? ");
				
				try {
					String input = in.nextLine().trim();

					System.out.println();
					
					// Check if the input signifies a return to the main menu
					if (isReturnToMainMenu(input)) { 
						throw new CancelOperationException();
					}
					
					result = input.toLowerCase().toCharArray();
					
					if (result.length == 0 || (result[0] != 'y' && result[0] != 'n')) {
						throw new IllegalArgumentException();
					}	
				} catch (IllegalArgumentException ex) {
					System.out.println("Invalid entry, please re-enter your selection.");
					validInput = false;
				}			
			} while (!validInput);
						
			return result[0] == 'y' ? Order.TIMESTAMP : Order.PRIORITY;
		}