Function for comparing two Chains