modified elsif and user input to interger in the last line