Updates: Finish the main functionality of the programme.
Bug fixed: Fix some minor bugs.