JS reworked to complie better (maybe even really good)