added comment row, some code refactoring