merging for loops , proper paging & a typo