Floating Menu System

I’ve been trying to develop this menu system in which you can collapse/drag and rearrange menus. I’ve attached what I have so far, but I’ve been running into problems and I’m hoping someone can guide me in the right direction.

One of the larger problems I’m at right now is rearranging the menus. If, for example, I move the top menu to the bottom, the other 3 menus don’t shift up and I can’t seem to figure it out.

Any help would be really appreciated.