Code written to complete the assignment for online course by Stanford University