made y a global variable and added a  route for the reset button