added some pseudocode to check_row function