improve memory management and clean up a bit
Merge branch 'master' of https://github.com/psi46/pxar