@Override
    public String getCommand() {
        Scanner inFile = new Scanner(System.in);
        String command;
        boolean valid = false;
        do {
            command = inFile.nextLine(); //gets input
            command = command.trim().toUpperCase(); //changes it to uppercase
            if ("H".equals(command) || "N".equals(command) || "C".equals(command) || "Q".equals(command))
                valid = true;
            else {
                System.out.println("Invalid command. Please enter a valid command.");
                continue;
            }
        } while (!valid);
      return command;
    }