encode slices to list