Improved also boundary management in the refinement/spring relaxing. Added a parameter for controlling the preprocessing refinment