flipped_bits now shows for each iteration from 1 to 9
changed threshold to float