weights range from 0..max_grade