Stanford CS193P Assignment 2 (lecture 3)