Original source code by andreasjansson, just changed ze and zir to ne and nir