added IO functionallity