added code from last year; midway in fixing a few things.