add writestructs