updating demo and js file to reflect documentation