simple test function for calculating error rate. will update later