Homework3 of TOC.