http://cuttherope.net/scripts/sm2.js