category logic added --KW