created weighted similarities using A matrix