basic io functions and field init