added fileio function