This is the code I wrote