Use events to start and stop playing. Clean up and reorder the code.