added support for summarize function

Added support for summarize function as per issue #35