The General Idea

Got the algorithm working ,need to clean up for the project.