fixed dense function with access to years list.

years variable was undefined for dense function. I didn't find any other place the years variable was used.