making javascript work