implement command line flags
split directory reading into functions