Rewrite of the has_rows function. Also changed name to have_rows

Signed-off-by: Elliot Condon <e@elliotcondon.com>