extended the size of temp so that idtitle does not get overwritten
modified the writing method for triangles so that is can be imported correctly through DM