Re-wrote third challenge. More logic to handle command-line arguments, added comments.