I fixed a few bugs. I tested this code and it went through 0 through 9 on the 7 segment.