Add comments, refactoring