changed writeConfig function to write to STDOUT by default.