double lastBorePosition = borePoint.getBorePosition();
geometry[0] = borePoint.getBorePosition();
borePoint = (BorePoint) sortedPoints[referencePointNr() - 1];</BUG>
double priorBorePosition = borePoint.getBorePosition();
<BUG>for (dimension = 1; dimension < nrDimensions; ++dimension)
{</BUG>
pointNr = borePointNr(dimension);
borePoint = (BorePoint) sortedPoints[pointNr - 1];
geometry[dimension] = (borePoint.getBorePosition() - priorBorePosition)
/ (lastBorePosition - priorBorePosition);

double lastBorePosition = borePoint.getBorePosition();
if (unchangedBottomPoint == 0)
{
geometry[0] = borePoint.getBorePosition();
dimension = 1;
}
borePoint = (BorePoint) sortedPoints[referencePointNr() - 1];
double priorBorePosition = borePoint.getBorePosition();
for (; dimension < nrDimensions; ++dimension)
{
pointNr = borePointNr(dimension);
borePoint = (BorePoint) sortedPoints[pointNr - 1];
geometry[dimension] = (borePoint.getBorePosition() - priorBorePosition)
/ (lastBorePosition - priorBorePosition);
