better discrete distribution generation