I did a fast view and saw a lot of references like this
$doc->deck->elements->visible = 0;
I thought using numeric indices would make very hard to "move" a new element ip in a given form? Things could break...
In other codes I see this, which seems to be better
I did move my element up, so I guess the element index changes all indices by 1, down the form