Add ability to load old style samples
fix z matrix