changed calculation of node ids