new main Fn