Added a case of year < 1000 + a case of year > 3000