Swapped out the implementation for something that uses a stack instead