v.10

Refine class Main, finalize the function.