Added template function for retention probability as a function of length & size limit