This is my homework in coursera online course.