Added get rows function