Start of an attempt to refactor code, to allow for multiple tpyes of rois.