Speeding up line/column calculation, and breaking it