implemented javascript stuff