Combined and updated everything

See line 141
Not sure what numrows is for