added boundary conditions, improved docs