Added a reset button, fixed and refactored counter