write_tet index bug corrected