hello, im new to this forum and would like to say hi.

I am insulating my garage and was thinking about foam. my garage is the old all wood type 2"x4" studs with 1"x6" siding. my question is can I apply foam to the inside of the roof and rafters? Will the foam fill all the gaps of the wood drying out over the years, and what will happen when I have the roof reshingled? will the insulation come loose? I also have a wood burning stove can I apply foam next to the brick chimney?

thanks