A bunch of comments for clarity of the code