Added Yuan's changes