Satisfies week 4 of the machine learning coursera course