revise logic