added demo, simplified js