pulled list creation out of main into a function