add distance and set cluster method