add function printRow and test case