Added 'by' method

This provides "group by" functionality