minor fixes, but porosity not being calculated correctly