Coalition Formation with Heterogeneous Agents