Optimized of  window search a bit.
Limited digit input to 5 digits.