added generic method to compare correctness of two algorithms. Now only need to measure.