Use Stack instead of native ArrayList here