automatic merge of categories - not finished yet