Final line and alert has been added to give the output to the user.