implemented windows, groupBy and groupByUntil