added command mode
word frequency method