Further updates to code base to improve inversion code