added stacks code