Finished the javascript port