updated and rationalised some fucntions

@julry, this is the corresponding PR from the DAGMC one. Works brilliantly too :)