Got recursive and imperative stack generator working