How to draw four rectangles starting point each one is the end of the other

Hello all
I try to draw four rectangles starting point each one is the end of the other rectangle but I get the rectangle first and last only, where is the error?
EX.gh (9.1 KB)

image
As in the picture, the black rectangles are what I want to draw using this algorithm, but the result of the algorithm is red rectangles

image

EX_2019Jun25a.gh (8.7 KB)

EX_2019Jun25b.gh (7.3 KB)

Thank you Mr. Joseph thank you for your repeated help, I really benefited from your feedback