added logic to exclude if any grades are nil