Should be an <= comparison, not a < comparison.