finished assignment 2 for Coursera Course