fixed and started with tiling logic