wrote reheader and calmd methods plus tests