Added stack code