First working version with hierachical return stacks tested in simulator