finished up the logic for handling settings