added command line tools for main. can now have opts -t -d