fixing the bugs in the tile game