added verify function

Mainly added verify function to handle user input. The rest are minor
changes.