Made the javascript work

also fixed typos