adding numerous helper functions required to drive CAM and analyse model output.