Add new functions for handling version numbers.
Print less debugging output.
Reorder some code.
Add comment.