Finished phase 2, still need to debug
Finished phase 2.