Improved logic.