fixed summarize call in line 86 to use explicit call to dplyr:summarize().)