Comparison function--completed and passed testing.