almost finish main function