more on slicing alg

trying to reuse code and make it sort of recursive