adding printRows method