refactored the project layout and fixed the example