functions add category logic