refactored problem report so it now stores error per statement (also avoids duplication during iteration)