fixed bugs and Restructure the project