Various updates to graphing routines, C distance calculations and power matrices