Coursera submission for assignment 2