--		local grid = scroller:WaitForChild("UIGridLayout")

		local function GetGuiObjects()
			local objs = {}
			local c = scroller:GetChildren()
			for i=1, #c do
				local o = c[i]
				if o:IsA("GuiObject") then
					table.insert(objs,o)
				end
			end
			return objs
		end
		
		-- updates the CanvasSize based on the amount of frames in the frame, along with
		local function Update()
			scroller.CanvasSize = UDim2.new(0,only_y and 0 or layout.AbsoluteContentSize.X,0,layout.AbsoluteContentSize.Y + 25)
		end
		connections[scroller] = {
			layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(Update),
			scroller.AncestryChanged:Connect(function()
				if not scroller.Parent then
					AutoCanvasSize.Disconnect(scroller)
				end
			end),
			scroller.ChildAdded:Connect(function()
				spawn(Update) -- it appears the child does not get added until the connection returns (or something of that effect)
							  -- so, we spawn the Update so it is inclusive of the new child.
			end),
			scroller.ChildRemoved:Connect(Update)
		}
		Update()
	end
	
return AutoCanvasSize