use foreach rather than const_iterator
add labels to display explanation for similarity measures + fix indents