Added some more comments. It works.