cleaned up how the rows are generated