Update, some trade-off

Tried to achieve better accuracy with javascript, but turns out I need
to change a lot. So I tried the best accuracy with php. Will get much
better when switch to node.js