added more javascript functionality