added routine to compute_slice