corrected logic on number of count of articles per category
correction, code formatting and logic debugging
refactor