Changing structure according to suggestions from Michael Klobutschar.