Wasn't following the advice either, after reviewing it.

Solved problem in more complex, but more understandable way, including new comments that explains problem and reason why the solution works.