Coursera assignment 2 attempt 1