Title: Electronic theory for the atomic structure at the surface of transition metals and alloys: segregation and chemisorption effects