removed side-effect of changing pos in get_current_cell_number