some editing on the js
cleaned the code