finished the getInput method