Changes to be compatable with DIP report plugin. Might need more thought