updated stack initialization