Added some comments and changed some things