did some code cleanup and commenting based on StyleCop suggestions.