fixed the code that computes slices and wrote an example for it.