clean up variable stack
merge
both test cases pass