Removed dead code
Removed creation of unreferenced variable
Updated ncvar code to deal with new class definition of sdpvar
More precomputations to improve speed