1. refactored the method paraemeters from String to int
2. added exit alert