use file objects instead of file name strings