finish cell_location function