handle inputs as in the book chapter 8
checkin input.js