combine integrate.py and similarity.py