better clear graphs method