added node gathering logic