fixed code to take into account grades less than 0.0