Write splice appropriate ys function