Not sure if this piece of code is related with this PR or a previous one but, it could be cryptic, e.g. this mysterious "-2" and "ie"... could you add a comment above this lines to explain its purpose, please?