instead of manual loop.