move "add-to-list"s into the function