Added basic input handling code