reordered logic of building days in year