updated version of auto-complete