Code

move error scans to a new separate routine and scan both stderr and stdio