introducing subcats function