replaced all native file io with wrappers

added new functions
clone_page()