bug fixes, added demo scripts