Added comments explaning descisions and what the code does. Also took the opportunity to slightly refactor the validation logic.
Merge pull request #2 from HennyH/document-range-C-code

Added comments explaning descisions and what the code does. Also took th...