Corrected invmag, tidied up for lenswrangler
Corrected invmag, tidied up for lenswrangler