some javascripts from sliceworks