I'm currently adding a function to my code that looks up an element in a list based on some key and then returns that element as a reference. If the key is not yet present in the list it should create a new element, add it to the end of the list and then return a reference to that element in the list such that when I edit it outside of the function it will be changed within the list. What would be the best way to do this?I'm currently adding a function to my code that