Removed useless TileSize object and adapted the code