Rework WriteMap to allow for multiple files