performing clean up of dead scripts and adding comments for more readable code