the making of gist #5112097 This is the actual process I went through while working up the code in the aforementioned gist.