refactoring and function descriptions done