implemented setBoundaryConditions