adjusted reporting, so that it can now writ eback to the DB
lots of changes