Adds comments and improves readability