added automatic selection spacing and generation