added stacks generic implementation