First cut at an IPython notebook for this problem. Not working yet.