How to fix the sticking or finicky sunroof on a Mini Cooper

Simple fix when the sunroof has trouble opening or closing. Hot sun causes the sunroof to expand and not so soft anymore rubber gasket causes friction.