add classification and mosaic plot functions.
fix check problems.