Added and tested type stack computation.