Final version. Hopefully I wasn't too verbose.
Added the generated images