added output function to check category numbers, bugs need squashing