Changed the algorithm of finding the ground profile extend, which is now
done every time the ground profile is refined