adding test for TempStack and also finding bugs - weee!