Making play function a bit more generic