implementation of flattened slices