reset button added, along with general DRYing of code