add function Main and readfile.