starting to port slicing code