add makewidgets function