Added comments.
Removed use of local char buffer