Revert "variable 'year' referenced before assignment"

This reverts commit 240283405e5389a77642ccfd68d619313142635e.