added write-config script