original revised for null values