combined collections and updated category detection algorithm; fixed bug...

... in category detection