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