Added a few comments and renamed stuff