added argmin logic