worked on io functions