Beamscattering

update beamscattering code to the master branch