added stacks support, tests,docs