added rows cols and plotting functions