updated risk and stack
updated stack impl