Solutions for 1.2-3, expand 1.1 solution.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>