It seems like the issue lies in how you're calculating the averages and differences in your method. Let's break down your code and see where it might be going wrong.

Your method `avgNode()`...