Compare function now works