Added slice function.