adding implementation of slice (using split