refactored cmdline params & added --debug