added clearing ability to reset button, got rid of global variables