This is the third answer in coursera