Added configs and code for single-instance case.
Added code and configs for the multiple-instance case.