Implemented the settings logic