an ok version, nrow needs to be updated