updated file writers and readers