writing values to file