first draft of relation processing.