moving from list comprehension to an actual dict function