Added CLI arguments, other improvements.