pass around num-rows/num-cols everywhere properly