updated populate func