refactored flow control for wait_for_REQ, and switched all the status codes to have an IFG_ prefix