updated stack peeking