Added check for negative integers and to display message on quiting
Added comments to the code