Updated reset function so it actually works