Adding comments

More detailed comments to the code