Code snippet for isEqual: