We need the intermediate list here as we iterate over it as well as have a need to call len