@xiangli-cmu Please change the logic and merge when you have a chance.