refactor leave/enter to be more efficient; simulate second function call to verify proper stack alloc