Why do you want the minimum non-zero index? Wouldn't you want the max?