Updated code to use analyze.data_slice()