modified choose best attribute