M5/master calendar math

#23