Fixing node management when eating other node

Problem in array list index