moved input routine to input.lua