Help with rectangular pipe script

Hi,

I almost have this working but I need to create rectangles centered on the curves, rather than below the curve. See picture:

Fixed by using 4-sided polygon