Updated analysis:
categorical analysis;
updated code