Beam Splitting algorithm