Modified maxm and minm