cleanup; start work on calendar function