Added play control logic