update documentation in the code. renamed some method names