added io functions