added playerSelected function