add document structure comments and export c to own file