Code for "Slices of Pi - A Universal Grandfather Clock"