documentation and error throwing