streamlined more, also write out input projection to z and mva