added reset button and corrected calculation