Cleaned up the Code

And added comments where comments where needed
Merge pull request #1 from Skoog/skoog/cleanup

Comments added & Code clean up by P.Skoog