refactored play index conditional