factor out a stepBeams method, see #38