Polyline drawing Order?

Is there an order in which polylines are drawn?
I am adding multiple polylines but would like certain lines to be on top.
I thought this could be accomplished by adding the ones to be on top last. This works partially but not always.
Is there a way to force the drawing / overlay order of the polylines.

I believe I have it working now using zorder parameter.

The zorder parameter is indeed the parameter to use to control the Z ordering of polygons/polylines.