Added triple count functionality.