Improved speed with global min