Digit stack problem solved