add function to calculate common neighbors