some changes from the add_new_analysis branch