restored previous commented out code but fixed the bug causing missalignment of the tiles when moving