fun logic problem. Will do a list comprehension next