counting of types of errors works