Upgraded logic.