Added some comments and name refactoring