Fixed #5 and reformulated the code

Boundary conditions added to the utility.