updated to allow user input of natural number