Reading and writing settings functions added