added support for stack https://news.ycombinator.com/item?id=7590753