implemented rows and cols functions