if statement added to determine the outcome of the users input. comments added.