Implemented a basic user-input loop