Adds stop functionality. Using the same flag for internal and external operations opens up the opporunity for bugs to occur if keys are mashed, however I am okay with it for now