Added a debug function. Added CLI option parsing.