adaptation to recieve an array of categories instead a string