Updated position calculator to not move past target node