calendar calculations revised