updated js implementation to remove the memory leak
Merge pull request #14 from eitanmk/gh-pages

Removed memory leak