more usage of pdinv
lots of tidying of the compuational parts of mohgp