some function updates, trying to get groupby working (its not...)