use min instead of avg because why not