Made working code for input