added javascript file
wrote documentation #143