corrected bug in the efficiency calculation