fixed nested if problem, also added stack.h
fixed nested if problem, also added stack.h
fixed nested if problem, also added stack.h
merge