Some error fixing and tidying, starting to add DAs code from add_data