Finished implementing new charts

Also cleaned up code