changed leapyear() implementation