Added recordHistory Function, getInput Function