added code sample for comparing based on fields