fixed tune function to work with formulas