Modify stack definition and implementation.