rewrite the xplayer class