Add run branch

Implementation of add_run and close_run