updated nrow with length(C)