add tests for 'slice'
implement 'slice' function