write extractPage(List list, int limit, int offset) utility to be called in both places