Added command line flags and comments.

Cleaned up code.