rewrite so we can utilize in other instances like ractive.draggable.js