Bug Fix and Comments

I had to redo these changes because I had some technical difficulties
trying to merge these changes with the master branch. So, I simply added
the changes directly to the master branch.