code for updating plays