Basic javascript functionality done