added update_player() function