fixed groupby formatting and logic
Bug fixes with history widget colouring