better code for player