simplified csv writing by referring to DictWriter restval attr instead of checking for a keyword arg
now using mostly generators instead of list comprehensions