save to file function wrapper
harmonic function