implemented writing of curve files to disk.