optimized random: 2.99 s