added center_to_beam function