algo lib for javascript