added new code for W efficiency calculation and closure test