Add event handlers and play function