use stack to Simplify Path