Added __main__ block.
Fixed day=0 bug.