updating comments and some slight syntax updates to make the code more
readable.