find a key in a list, return its index