fixed bug in offset calculation, numRows->numCols