Exercise #1 in CS193 (2013)