added slice() function