Code documentation

Add XML comments.