variable for dayInYear was corrected