added a few comments in def main() explainging what's going on.