public Command getCommand() 
    {
        String inputLine;   // will hold the full input line
        String word1 = null;
        String word2 = null;

        System.out.print("> ");     // print prompt

        inputLine = reader.nextLine();

        // Find up to two words on the line.
        Scanner tokenizer = new Scanner(inputLine);
        if(tokenizer.hasNext()) {
            word1 = tokenizer.next().toLowerCase();
            if(tokenizer.hasNext()) {
                word2 = inputLine.substring(word1.length() + 1).toLowerCase();
            }
        }

        // Now check whether this word is known. If so, create a command
        // with it. If not, or if the player entered "" (null), create a
        // "null" command (for unknown command).
        if (word1 == null || !commands.isCommand(word1)) {
            return new Command(null, word2);
        }
        return new Command(word1, word2);
    }