added elective selection algorithm