changed to stack based algorithm for better performance
fixed stack
throwaway
fixed the stacked based implementation of the Accumulation