cleanup code and tests
fix leap years