Unit selection logic improved