category change script changes

Redefining html elements, logic and methods have stayed the same