lazy functions now retrieve records as needed, instead of one iteration ahead of time