Improve comments, eliminate magic numbers.