Update to #259 - Reformat, add more documentation in comments.