implemented isDirty with array equivalence test