done all main function