updated stack to store a pointer data