added multi-indexing
added groupby functions, removed multiindex