writeFiles function added