Refactor classification

Now I need to figure out how I used to calculate gavg... to average over the
samples in s.db