added some more javascript functionality