Added testing words for sort
Fixed next_empty_row to check for text or position