Updated the riot.js rewrite to be closer to the lesson plan