Added stack allocation