refactor calculcate nodes per exact number of stops