num_rows fixed

edited num_rows and removed some buggs