Optimizing Problem of a Window

"A Norman window has the shape of a rectangle surmounted by a semicircle. (Thus, the diameter of the semicircle is equal to the width of the rectangle.) If the perimeter of the window is 22 ft, find the dimensions of the window so that the greatest possible amount of light is admitted."

(I've seen some forum posts about optimizing Norman Windows, but I've still gotten stuck. I was hoping to get some help with my problem.)

EDIT: Okay, I'm still having trouble, even though I've reworked it to fit the problem properly and solve for optimized dimensions.

Perimeter: $\displaystyle \pi r + 2h + 2r \:=\:22\quad\Rightarrow\quad h \:=\:\frac{22 - 2r - \pi r}{2} $

Substituting: $\displaystyle P \;=\;\pi r + 2\left(\frac{22 - 2r - \pi r}{2}\right) + 2r $

And now I have trouble. I know I needed to plug in my solved h to eliminate a variable, then simplify, and then take the derivative.

But simplifying it brings it back to P = 22, which... isn't what I need.

Simplifying: $\displaystyle P \;=\;\pi r + 22 - 2r - \pi r + 2r $

$\displaystyle P \;=\; 22 $

Clearly this isn't the right method! I don't know what I'm doing wrong. Usually I'm supposed to work with Area too, but that shouldn't be involved this time, should it?