Added optimization and unit tests to grade scale lookups