Use CPS to avoid ugly reverse.