modified stack allocation