This is the code that I think works