mistake
Revert "mistake"

This reverts commit 7e3664243e91dd1a0c38da574eda44a360d3b482.
Huge changes to javascript

optimized the code a lot