Improve debug output
Refactoring.
Renamed some variable.