tweeking for more concise implementation

instread of piping grep output to wc, used grep with -c flag