Minor changes, mostly comments

Adding comments, cleaner indentation, a few minor code modifications