implements slice() method for List