in reply to RFC: beginner level script improvement

A few random suggestions after skimming your code: