redid loops to extend slab