writing to settings file
cleaned up code