Part of a homework assignment required for a class I took through Coursera.