But when testing my program, it never repeated the same byte for me. Some test cases: INPUT FILE: OUTPUT: abccd 99 abcdAABCD 65 a b c d e 10 13 // these two are the bytes of the end of the lines, so also that's OK in my opinion. aaabbbcccddd 97 98 99 100 // each byte occurs equally often, so each byte is displayed. Maybe the problem with the validation again is that I'm using static variables in the program?... (This has caused problems before, even though the program worked perfectly.)