added the slice implementation of stack