Cleaned up update function player