Some changes to js, ajax, and population functions