added resource groups and more re jigging of element order