Modified column gathering technique: refactored to be more algorithmic