Fix loop so it's simple (and works)