version of make-int-list using loop