updated calendar code