added demo project, fixed bugs