beam.cpp formatting