Print time at end, fixed crash when invalid key is pressed, and fix off by one error