Modified fk to write longer format distances and GFs