1) missing words error fixed
2) mem optimization
3) little speed improvement