put the stop and rm commands in functions