Flow chart corrected

as well as clean up work to code