Using debug flag to control debug statements

Added ability to execute file from command line