Docstrings and better comments for is_valid_recurrence