ex1 in coursera.org