For coursera assignment 1