fixed slicer code