Lorentz gas algorithm