Maximizing Connectivity And Performance In Mobile Ad Hoc Networks Using Mobile Agents