Added a few comments and made a few small changes