Use equal() instead of compare() for testing equality