updated the presentation and comments to make things more readable