major refactoring - made all the play events a function