removed usage of diff
Changed Base.diff for ArrayFun