public Command getCommand() {
        String inputLine = "";	// holds the full input line
        String command = null;		// holds the first word of the input line, if any
        String[] parameter = null;		// holds the second word of the input line, if any

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

        // read the input line
        try {
            inputLine = reader.readLine();
        } catch (java.io.IOException e) {
            System.out.println("There was an error during reading: "
                    + e.getMessage());
        }

        //extract words from the input line
        StringTokenizer tokenizer = new StringTokenizer(inputLine);
        
        // get first word
        if (tokenizer.hasMoreTokens()) {
            command = tokenizer.nextToken();
        } 

                
        //get all other words
        String[] tmp;
        while(tokenizer.hasMoreTokens()){
            //start condition
            if(parameter == null){
                parameter = new String[1];
                parameter[0] = tokenizer.nextToken();
                
                //every turn after the first
            }else{
                tmp = parameter;
                parameter = new String[tmp.length + 1];                
                System.arraycopy(tmp, 0, parameter, 0, tmp.length);
                parameter[tmp.length] = tokenizer.nextToken();
                
            }
        }
       
        

        // check whether the first word is known as a valid command
        // if so, create a command with it
        // if not, create a "null" command (for unknown command)
        if (isValidCommand(command, parameter)) {
            return new Command(command, parameter);
        } else {
            return new Command(null, null);
        }
    }