Moved play to function