Eliminated more code and made chart updates work.