added stacks and bit manip