Refactored to clarify intent
Applied "standard" indentation
Simplified printing logic