working producer function