Added the fileio functions