added group plot function