Corrected statistic logic, wrote test case