Implement commonNode algorithm