Refactor + added ignore overflow

* replaced var1 with var in functions where there was only one variable
* changed numpy.seter(....over='ignore') to stop warnings when
  multiplying masked arrays