added function for printing category; streamlining and less possibility of errors, issue #25