added category selection and machine learning