more loops and resizing