Added code to check if year is a leap year