This is the code that Matt and myself worked