rewritten logic.