translated comments and section identifiers
removed unused local variable
replaced print by return value
added example configuration