fixed some loop issues and made the input more user friendly.