Added some comments; it's close to working...