All code used by Xiaolei Shi