resetting things upon returning to the settings
restructuring of visualisation code