category analysis (plus some minor stuff) updated