correctBoundaries