adds semi-working JavaScript code