adding new process distances function