move frontend embedding code here