aMade some changes to John code so that it is single state selection