fixed up code on slices