implemented hw 3, part 3 from https://class.coursera.org/startup-001/assignment/view?assignment_id=8