Fixed a glaring problem w/ z matrix calculation