Format

No functional changes
Fix style

No functional changes
Add missing @tailrec