the way it works is sorta simple, honestly - both layers are simulated at the same time, and anything walking into or out of the box makes a corresponding object leave the box in the other layer, if it's baba, swapping which of the two layers has priority