added condition to check if the minimum is the center