most of this code is right. just have to figure out why it is having trouble counting the number of items per row