Copied modifications from demo project to main sources