using new style minmax functions