some aesthetic changes, as well as adding a try/catch block for the first input