removed stray before and after console logs
added reset function