try to get z working, needs a rebase against master though