Changed to call sortedWidgets method once