Added example to the docstring of Beam. Passes doctest.