add some comments and rename methods to make more sense