updated program to include categories