Adding a writeconfigfile function
Merge branch 'master' into develop