Array.prototype.swap = function (x,y) {
var b = this[x];
this[x] = this[y];
this[y] = b;
return this;
}
var sortable = Sortable.create(el, {
'onUpdate': function(evt) {
pieces.swap(evt.newIndex, evt.oldIndex);
pieces.swap(evt.oldIndex + 1,evt.oldIndex)
}
});