return position of minimum instead of value