added tabs and refactored