Finally final changes to javascript
I dont know what Ive done