After testing: Fixed logic in scan/parse section in main so that debug runs continuously until turned off.