1. Refine sort code

2. Add stack