Shuo's LME code