Added support for repeats calculation.

Needs to be tested. Needs to have support added for max
distance.