Added a check to minimize u