Added calculation of testing error;