recalc() code and freq_shape_buf dumping to text file