old code ; not the best-formatted, but a very impressive feat - a custom calendar module