changes for wrong distance generation