Update functions2.R

output data and coefs