Finish main.