fixed a minor bug in js implemention
add gitignore file