Tweaked js script