2nd Loop in program
Merged greg's changes.