adding some code for categorical data analysis