added the code to handle the scrapping and looping for categories and categorires
refactored the main look to have functions not thie whole code