implemtent function for category.