refactored. removed old comments