Added tile_rect function