refactor playX and playY