Bug fix

Fixed wrong index given to ClassChangingNode by for() loop, fixed abs()
to Math.abs()