updating on main function