added automatic category generation.