added isEqual function