minor chang
modified to deal with ways/nodes