@francismakes fork of squareroot.js by @drojdjou