Realised I had a stub for inv_mixw. Moved new code and removed old function.