added toggles and updated functionality