calculate rows an columns in place on demand