assignment8 from Fangyun Sun