Added some comments, may need to add some more text here, but otherwise it looks fine.