reformed the project to be in synch with the distributed sample code