improved if selection