add the calculateNodePositon method