typo
corrected order of checks in cov()