Converted Array.prototype.diff and cleaned up a for order of operations issues