calendar printing algorithm changed