revise iteration rand method