updated looping and embed logic