Refactor the startStop function to handle stopping the timer as well