a lot of fixes, including adding z-positions
tiny last few changes