added javascript functionality, but still beta