made logic for starting and stopping playing better