first try with distribution
now with real input
fixed BGP Test 5, but quite dirty