First pass at writing files