How do I make an AND input function?

I put the flip flop in, and it works perfect… until I change the end point variable higher than about 200…

Any idea on that…?