commented code and trimmed the fat