creating a stack that uses slices with copy