Debugging Complete

Debugging Complete, further tests and refinements needed.