New function isEqual for comparing values