adding read function for FileIO.java