fully working auto populate