Unstable. Still working on it.
Working on COP maximization code
COP calculation is done. Need to work on diag now.