What looks like a working version of the code