SPM hw6&7 For SPM hw6&7 code review and academic use only. Reference: https://rosymoggy.blogspot.com/2014/01/c.html