used new function that takes dictionary form to file form