First part is here: http://joyreactor.com/post/737740