more cleaning
nearly done with implementing select_beam