tried to reorder the program structure and build process