Clean up code, add reset function, fix fire logic