Fixes #1, code clean up

Uses data from the query response to establish year instead of assuming
that they are in year order