Use stack structure to keep track of radix