used in Coursera Data Science class