Boundary correction

Moved boundary computation to its place in assembly method