Reverted debug output. Test results: both methods achieve same aim.