handles output and errors but doesn't pass in PFA document yet