modify from uc branch 2