add io functions & data structure