added methods for creating and writing files