adding io functions (lessons 2.7 to 2.9)